﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SchoolLibrary.Utils;

namespace SchoolLibrary.Desktop.Common.Component
{
    public class NumericTextBox : FixedLenghtTextBox
    {

        public NumericTextBox()
        {
            this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.keyPress);
        }
       
        private void keyPress(object sender, KeyPressEventArgs e)
        {
            if (!StringUtil.isDigit(e.KeyChar) && e.KeyChar != StringUtil.BACKSPACE_CHAR_CODE)
            {
                e.Handled = true;
            }
        }
    }
}
